import {useEffect, useState} from 'react';
import styles from './index.module.less';


const ROUTER_MAP: any = {
    '/universe': {
        '/passengerflow': {
            ch: '全域客流监测',
            en: 'Monitor for Passenger Flow in All Regions',
        },
        '/complain': {
            ch: '全域投诉监测',
            en: 'Monitor for Complaints in All Regions',
        },
        '/resource': {
            ch: '全域资源监测',
            en: 'Monitor for Resources in All Regions',
        },
        '/group': {
            ch: '团队监测',
            en: 'Monitor for Tour Group in All Regions',
        },
    },
    '/scenic': {
        '/passengerflow': {
            ch: '景区客流监测',
            en: 'Monitor for Passenger Flow in Scenic Spot',
        },
        '/complain': {
            ch: '景区投诉监测',
            en: 'Monitor for Complaints on Scenic Spot',
        },
        '/comment': {
            ch: '景区网评监测',
            en: 'Monitor for OTA Comments in Scenic Spot,',
        },
        '/resource': {
            ch: '景区资源监测',
            en: 'Monitor for Resources in Scenic Spot',
        },
        '/newMedia': {
            ch: '景区新媒体监测',
            en: 'Monitor for New-Media in Scenic Spot',
        },
        '/forewarning': {
            ch: '旅游综合预警',
            en: 'Comprehensive Tourism Warning',
        },
    },
    '/hotel': {
        '/complain': {
            ch: '住宿投诉监测',
            en: 'Monitor for Complaints on Hotel',
        },
        '/comment': {
            ch: '住宿网评监测',
            en: 'Monitor for OTA Comments in Hotel',
        },
        '/resource': {
            ch: '住宿资源监测',
            en: 'Monitor for Resources in Hotel',
        },
        '/overnightPassenger': {
            ch: '过夜游客监测',
            en: 'Monitor for Overnight Visitors',
        },
    },
    '/guide': {
        '/index': {
            ch: '导游团队监测',
            en: 'Monitor for Track of Tourist Guide',
        },
    },
    '/travelAgency': {
        '/complain': {
            ch: '旅行社投诉监测',
            en: 'Monitor for Complaints on Travel Agencies',
        },
        '/resource': {
            ch: '旅行社资源监测',
            en: 'Monitor for Travel Agencies Resources',
        },
        '/bus': {
            ch: '旅游大巴监测',
            en: 'Monitor for Travel Agencies Resource',
        },
    },
    '/traffic': {
        '/aviation': {
            ch: '航空旅客监测',
            en: 'Moniter for Air Travellers',
        },
        '/railway': {
            ch: '铁路旅客监测',
            en: 'Monitor for Travel Agencies Resources',
        },
        '/highway': {
            ch: '高速车流监测',
            en: 'Monitor for Travel Agencies Resources',
        },
        '/road': {
            ch: '景区道路监测',
            en: 'Monitor for Travel Agencies Resources',
        },
    },
    '/stadium': {
        '/museum': {
            ch: '博物馆资源监测',
            en: 'Monitor for Museum Agencies Resources',
        },
        '/library': {
            ch: '图书馆资源监测',
            en: 'Monitor for Library Agencies Resources',
        },
        '/culturalCenter': {
            ch: '文化馆资源监测',
            en: 'Monitor for CulturalCenter Agencies Resources',
        },
    },
    '/toilet': {
        '/resource': {
            ch: '厕所资源监测',
            en: 'Monitor for Toilet Agencies Resources',
        },
    },
    '/sports': {
        '/resource': {
            ch: '体育场资源监测',
            en: 'Monitor for Staduim Agencies Resources',
        },
    },
    '/village': {
        '/resource': {
            ch: '乡村游资源监测',
            en: 'Monitor for village Agencies Resources',
        },
    },
    '/enterprise': {
        '/integrity': {
            ch: '企业诚信监测',
            en: 'Monitor for Complaints on Hote',
        },
    },
};

const LeftMenu = ({group, path}: any) => {
    const [textObj, setTextObj] = useState<any>({})

    useEffect(() => {
        const groupMap = ROUTER_MAP[group];
        if (groupMap) {
            setTextObj(groupMap[path]);
        }
    }, [group, path])

    return (
        <>
            <div className={styles['cn']}>
                {textObj.ch}
            </div>
            <div className={styles['en']}>
                <div className="main-select-en">{textObj.en}</div>
            </div>
        </>
    );
}

export default LeftMenu;
